//Accepted
#include <cstdio>

#include <iostream>

using namespace std;

int t, x=1;
long long a, b, c;

long long modulo(long long aa, long long bb){
	if(aa>bb)return bb-aa;
	else return aa-bb;
}
int main(){
	//freopen("in.txt","r",stdin);//freopen("out.txt","w",stdout);
	scanf("%d", &t);
	while(t--){
		cin>>a>>b>>c;
		
		if((a<=0)||(b<=0)||(c<=0)){
			printf("Case %d: Invalid", x++);
		}
		else{
			if(  ((a+b)<=c)  ||  ((b+c)<=a)  ||  ((c+a)<=b) ||  (c<=modulo(a,b)) || (a<=modulo(c,b)) || (b<=modulo(a,c))  ){
				printf("Case %d: Invalid", x++);
			}
			else if((a==b)&&(b==c)&&(c==a)){
				printf("Case %d: Equilateral", x++);
			}
			else if((a!=b)&&(b!=c)&&(c!=a)){
				printf("Case %d: Scalene", x++);
			}
			else if(    ((a==b)&&(a!=c))   ||   ((a==c)&&(a!=b))   ||   ((c==b)&&(c!=a))    ){
				printf("Case %d: Isosceles", x++);
			}
			else{
				printf("Case %d: Invalid", x++);
			}
		}
		printf("\n");
		
	}
	return 0;
}
